package com.fit.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.fit.interfaces.Driver;

public class DriversBean implements Drivers {

	private Map<String, Driver> drivers = new HashMap<String, Driver>();
	
	/* (non-Javadoc)
	 * @see com.fit.service.Drivers#retrive()
	 */
	public Collection<Driver> retrive(){
		return drivers.values();
	}
	/* (non-Javadoc)
	 * @see com.fit.service.Drivers#save(com.fit.interfaces.Driver)
	 */
	public Driver save(Driver driver){
		return  drivers.put(driver.getName(), driver);
	}
	/* (non-Javadoc)
	 * @see com.fit.service.Drivers#retriveSingleDriver(java.lang.String)
	 */
	public Driver retriveSingleDriver(String name){
		return drivers.get(name);
	}
}
